package jp.sourceforge.akjrcp.audiotools;

import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.ui.param.ParamItem;
import jp.sourceforge.akjrcp.ui.param.ParamItemActionListener;
import jp.sourceforge.akjrcp.ui.param.ParamRadioGroup;
import jp.sourceforge.akjrcp.ui.param.ParamSpinnerAndScale;
import jp.sourceforge.akjrcp.ui.param.ParamTime;
import jp.sourceforge.akjrcp.util.TimeUtils;

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;

/*
 * still development?
 */
public class GroupSubtitleDialog extends  Dialog{
	
	long time;

	String title;

	private ParamSpinnerAndScale groupTime;
		public GroupSubtitleDialog(Shell parentShell, String dialogTitle) {
			super(parentShell);
			this.title=dialogTitle;
		}
		
		protected void configureShell(Shell newShell) {
			super.configureShell(newShell);
			newShell.setText(title);
		}
		
		  protected Control createDialogArea(Composite root) {
			  root.setLayout(new GridLayout(1,false));
			 groupTime = new ParamSpinnerAndScale(root,SWT.NULL,"group","time msec");
			groupTime.setMaximum(3000);
			setTime(400);
			  groupTime.setParamItemActionListener(new ParamItemActionListener(){
			
				@Override
				public void paramItemModified(ParamItem item) {
					time=(long)Double.parseDouble(groupTime.getValue());
				}});
		      return root;
		    }

		public long getTime() {
			return time;
		}

		public void setTime(long time) {
			this.time = time;
			 groupTime.setValue(""+time);
		}



	
	

	}
